<ion-header>
    <ion-toolbar>
        <ion-buttons slot="start">
            <ion-back-button [text]="'core.back' | translate" />
        </ion-buttons>
        <ion-title>
            <h1>
                <core-format-text [text]="title" contextLevel="module" [contextInstanceId]="moduleId" [courseId]="courseId" />
            </h1>
        </ion-title>
        <ion-buttons slot="end">
            <ion-button *ngIf="entry" fill="clear" (click)="save($event)">
                {{ 'core.save' | translate }}
            </ion-button>
        </ion-buttons>
    </ion-toolbar>
</ion-header>
<ion-content>
    <core-loading [hideUntil]="loaded">
        <core-group-selector [groupInfo]="groupInfo" [(selected)]="selectedGroup" (selectedChange)="setGroup(selectedGroup)"
            [courseId]="database?.course" />

        <div class="addon-data-contents addon-data-edit-entry {{cssClass}}" *ngIf="database">
            <form (ngSubmit)="save($event)" [formGroup]="editForm" #editFormEl>
                <core-compile-html [text]="editFormRender" [jsData]="jsData" [extraImports]="extraImports"
                    [cssCode]="database.csstemplate" />
            </form>
        </div>
    </core-loading>
</ion-content>
